package com.htc.android.footprints.animation;

import android.graphics.Camera;
import android.graphics.Matrix;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Transformation;

public class Rotate3dAnimation extends Animation
{
  private Camera mCamera;
  private final float mCenterX;
  private final float mCenterY;
  private final float mDepthZ;
  private final float mFromDegrees;
  private final boolean mReverse;
  private final float mToDegrees;

  public Rotate3dAnimation(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, boolean paramBoolean)
  {
    this.mFromDegrees = paramFloat1;
    this.mToDegrees = paramFloat2;
    this.mCenterX = paramFloat3;
    this.mCenterY = paramFloat4;
    this.mDepthZ = paramFloat5;
    this.mReverse = paramBoolean;
  }

  public static void SwitchView(View paramView1, View paramView2, Animation.AnimationListener paramAnimationListener, int paramInt)
  {
    Rotate3dAnimation localRotate3dAnimation = new Rotate3dAnimation(0.0F, 90.0F, paramView1.getWidth() / 2.0F, paramView1.getHeight() / 2.0F, 0.0F, true);
    localRotate3dAnimation.setDuration(200L);
    localRotate3dAnimation.setFillAfter(true);
    localRotate3dAnimation.setInterpolator(new AccelerateInterpolator());
    localRotate3dAnimation.setAnimationListener(new Animation.AnimationListener(paramView2, paramInt, paramAnimationListener)
    {
      public void onAnimationEnd(Animation paramAnimation)
      {
        Rotate3dAnimation localRotate3dAnimation = new Rotate3dAnimation(-90.0F, 0.0F, Rotate3dAnimation.this.getWidth() / 2.0F, Rotate3dAnimation.this.getHeight() / 2.0F, -this.val$zTarget, true);
        localRotate3dAnimation.setDuration(400L);
        localRotate3dAnimation.setFillAfter(true);
        localRotate3dAnimation.setInterpolator(new AccelerateInterpolator());
        localRotate3dAnimation.setAnimationListener(this.val$listener);
        Rotate3dAnimation.this.startAnimation(localRotate3dAnimation);
      }

      public void onAnimationRepeat(Animation paramAnimation)
      {
      }

      public void onAnimationStart(Animation paramAnimation)
      {
      }
    });
    paramView1.startAnimation(localRotate3dAnimation);
  }

  protected void applyTransformation(float paramFloat, Transformation paramTransformation)
  {
    float f1 = this.mFromDegrees;
    float f2 = f1 + paramFloat * (this.mToDegrees - f1);
    float f3 = this.mCenterX;
    float f4 = this.mCenterY;
    Camera localCamera = this.mCamera;
    Matrix localMatrix = paramTransformation.getMatrix();
    localCamera.save();
    if (this.mReverse)
      localCamera.translate(0.0F, 0.0F, paramFloat * this.mDepthZ);
    while (true)
    {
      localCamera.rotateY(f2);
      localCamera.getMatrix(localMatrix);
      localCamera.restore();
      localMatrix.preTranslate(-f3, -f4);
      localMatrix.postTranslate(f3, f4);
      return;
      localCamera.translate(0.0F, 0.0F, this.mDepthZ * (1.0F - paramFloat));
    }
  }

  public void initialize(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super.initialize(paramInt1, paramInt2, paramInt3, paramInt4);
    this.mCamera = new Camera();
  }
}

/* Location:           E:\workspace\dex2java\dex-translator-0.0.9.3\HtcFootprints_dex2jar.jar
 * Qualified Name:     com.htc.android.footprints.animation.Rotate3dAnimation
 * JD-Core Version:    0.6.0
 */